home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 2 / BBS in a box - Trilogy II.iso / Files / Hyper / Q-R / ResGenie™ 1.0 / ResGenie™ / ResGenie™.rsrc / TEXT_128_Crayon.txt < prev    next >
Encoding:
Text File  |  1993-08-02  |  7.9 KB  |  232 lines

  1. -- colorizeHC "colorFill", "221,160,303,229", "5243,65535,65535"
  2. --  "5243,65535,65535"   <--This is the current color
  3. --  221,160,303,229 <--- This is the current coloring rect
  4.  
  5. on mouseUp
  6.   if the commandkey is down then
  7.     newColor
  8.     exit mouseup
  9.   end if
  10.   if the optionkey is down then
  11.     locateMe
  12.     readytoScript
  13.     exit mouseup
  14.   end if
  15.   if the shiftKey is down then
  16.     deleteLastColor
  17.     exit mouseup
  18.   end if
  19.   togglecolor
  20. end mouseUp
  21.  
  22.  
  23. on locateMe
  24.   put "--" && "colorizeHC" && quote & "colorFill" & quote & "," && quote & the rect of ¬¨
  25.   me & quote & ","  && word 2 of line 2 of the script of me  into insertLine
  26.   put the script of me into holdScript
  27.   put line 1 of insertLine into line 1 of holdScript
  28.   put "-- " && the rect of me && "<--- This is the current coloring rect"into line 3 of holdScript
  29.   set the script of me to holdScript
  30. end locateMe
  31.  
  32. on toggleColor
  33.   set the lockscreen to true
  34.   locateme
  35.   if the showName of me is true then
  36.     put line 1 of the script of me into colorCommand
  37.     delete word 1 of colorCommand
  38.     do colorCommand
  39.     set the showName of me to false
  40.     go to this cd
  41.   else
  42.     set the lockscreen to true
  43.     colorizeHC "Erase", rect of me
  44.     set the showName of me to true
  45.     go to this cd
  46.   end if
  47. end toggleColor
  48.  
  49. on newColor
  50.   global TheColor
  51.   put "65535,4944,44180" into TheColor
  52.   put colorPicker("Choose a color.","",TheColor) into TheColor
  53.   if TheColor is  empty then exit newColor
  54.   if the result is not empty then answer the result
  55.   updateColor
  56. end newcolor
  57.  
  58. on updateColor
  59.   global TheColor
  60.   colorizeHC "colorFill",rect of me, TheColor
  61.   put the script of me into holdScript
  62.   put "--  colorizeHC" && "colorFill" & "," & quote && rect of me & quote & "," && quote & TheColor & quote into line 1 of holdScript
  63.   put "-- " && quote & TheColor & quote && "  <--This is the current color" into line 2 of holdScript
  64.   set the script of me to holdScript
  65.   locateMe
  66.   go this cd
  67.   put "Your Crayon is magically changed to RGB color:" && TheColor
  68. end updateColor
  69.  
  70. on deletebutton
  71.   colorizeHC "erase", the rect of me
  72. end deletebutton
  73.  
  74.  
  75. on readytoScript
  76.   global holdScript
  77.   set cursor to watch
  78.   put "Now checking all scripts..."
  79.   global holdScript
  80.   global colorauthoringpath
  81.   get offset ("makeitcolor", the script of this stack)
  82.   if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath)
  83.   get offset ("on makeitcolor", the script of this bg)
  84.   if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath)
  85.   get offset ("on makeitcolor", the script of this cd)
  86.   if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath)
  87.   set the showname of me to true
  88.   togglecolor
  89.   put line 1 of the script of me into line 1 of insertLine
  90.   delete word 1 of insertLine
  91.   put the name of me into check
  92.   if word 1 of check is "bkgnd" then
  93.     put the script of this bg into holdScript
  94.     put "bg" into wheretoGo
  95.     put "send makeitcolor to this cd" into whattoSee
  96.     put the name of this bg into myName
  97.   end if
  98.   if word 1 of check is "card" then
  99.     put the script of this cd into holdScript
  100.     put "cd" into wheretoGo
  101.     put "end makeitcolor" into whattoSee
  102.     put the name of this cd into myName
  103.   end if
  104.   
  105.   get offset (insertLine, holdScript)
  106.   if it is not "0" then
  107.     answer "This color has already been added here. Do you want to convert this to an ordinary button now?"¬¨
  108.     with "Yes" or "No"
  109.     if it is "Yes" then
  110.       do showdialog 3, "510",  , ,"Untitled" , "7",,
  111.       if the result is empty then exit readytoscript
  112.       put the result into hold
  113.       if line 1 of hold is "6" then set the style of me to "Transparent"
  114.       if line 1 of hold is "5" then
  115.         put word 1 to 2 of the  name of me into hold
  116.         put space & "id" && the id of me  after last word of hold
  117.         select hold
  118.         domenu "Clear Button"
  119.         choose browse tool
  120.         set lockscreen to true
  121.         opencard
  122.         exit readytoscript
  123.       end if
  124.       set the name of me to line 2 of hold
  125.       put "on mouseup" into line 1 of temp
  126.       put "   " into line 2 of temp
  127.       put "end mouseup" into line 3 of temp
  128.       set the script of me to temp
  129.     end if
  130.     exit readytoscript
  131.     if it is "No" then exit readytoscript
  132.   end if
  133.   put quote & rect of me & quote into checkRegion
  134.   get offset (checkRegion, holdScript)
  135.   if it is  "0" then
  136.     do put offset (whattoSee, holdscript)  into whereGo
  137.     put insertLine & return before char  whereGo of holdScript -- this should add the new colors
  138.     do set the script of  myName to holdScript
  139.     do put "This color has been added to" && the name of wheretoGo into message
  140.     answer "Do you want to convert this to an ordinary button now?"¬¨
  141.     with "Yes" or "No"
  142.     if it is "Yes" then
  143.       do showdialog 3, "510",  , ,"Untitled" , "7",,
  144.       if the result is empty then exit readytoscript
  145.       put the result into hold
  146.       if line 1 of hold is "6" then set the style of me to "Transparent"
  147.       if line 1 of hold is "5" then
  148.         put word 1 to 2 of the  name of me into hold
  149.         put space & "id" && the id of me  after last word of hold
  150.         select hold
  151.         domenu "Clear Button"
  152.         choose browse tool
  153.         set lockscreen to true
  154.         opencard
  155.         exit readytoscript
  156.       end if
  157.       set the name of me to line 2 of hold
  158.       put "on mouseup" into line 1 of temp
  159.       put "   " into line 2 of temp
  160.       put "end mouseup" into line 3 of temp
  161.       set the script of me to temp
  162.     end if
  163.     exit readytoscript
  164.   end if
  165.   if it is not "0" then
  166.     answer "You are painting in an area already painted. This is not necessarily a problem, but painting the same region twice will take longer." ¬¨
  167.     with "Cancel" or "Continue"
  168.   end if
  169.   if it is "Cancel" then exit readytoScript
  170.   if it is "Continue" then
  171.     do put offset (whattoSee, holdscript)  into whereGo
  172.     put insertLine & return before char  whereGo of holdScript -- this should add the new colors
  173.     do set the script of  myName to holdScript
  174.     do put "This overlapping color has been added to" && the name of wheretoGo into message
  175.     answer "Do you want to convert this to an ordinary button now?"¬¨
  176.     with "Yes" or "No"
  177.     if it is "Yes" then
  178.       do showdialog 3, "510",  , ,"Untitled" , "7",,
  179.       if the result is empty then exit readytoscript
  180.       put the result into hold
  181.       if line 1 of hold is "6" then set the style of me to "Transparent"
  182.       if line 1 of hold is "5" then
  183.         put word 1 to 2 of the  name of me into hold
  184.         put space & "id" && the id of me  after last word of hold
  185.         select hold
  186.         domenu "Clear Button"
  187.         choose browse tool
  188.         set lockscreen to true
  189.         opencard
  190.         exit readytoscript
  191.       end if
  192.       set the name of me to line 2 of hold
  193.       put "on mouseup" into line 1 of temp
  194.       put "   " into line 2 of temp
  195.       put "end mouseup" into line 3 of temp
  196.       set the script of me to temp
  197.     end if
  198.     exit readytoscript
  199.   end if
  200. end readytoScript
  201.  
  202. on deleteLastColor
  203.   put line 1 of the script of me into line 1 of insertLine
  204.   delete word 1 of insertLine
  205.   put the name of me into check
  206.   if word 1 of check is "bkgnd" then
  207.     put the script of this bg into holdscript
  208.     put "bg" into wheretoGo
  209.     put the name of this bg into myName
  210.   else
  211.     put the script of this cd into holdScript
  212.     put "cd" into wheretoGo
  213.     put the name of this cd into myName
  214.   end if
  215.   get offset (insertLine, holdScript)
  216.   if it is  0 then
  217.     answer "This color has already been deleted" with "Okay"
  218.     exit deleteLastColor
  219.   end if
  220.   get offset ("colorFill", holdScript)
  221.   if it  is 0 then
  222.     answer "You have already erased all the card colors" with "I knew that"
  223.     exit deleteLastColor
  224.   end if
  225.   put the number of lines of char 1 to offset(insertLine, holdScript) ¬¨
  226.   of holdscript into KillLine
  227.   delete line KillLine of holdScript
  228.   colorizeHC "Erase", rect of me
  229.   go to this cd
  230.   do put "This color has been removed from" && the name of wheretoGo into message
  231.   do set the script of myName to holdScript
  232. end deleteLastColor